/**
 * 
 */
package com.wqr.it.ecwdr.vo;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 产品基本信息
 * @author adinos
 *
 */
public class ProductItemVO extends BaseVO implements Cloneable {
	private static final long serialVersionUID = -195922916138270857L;
	private static final Logger log = LoggerFactory.getLogger("INFO");
	public static final int ISPRIME = 1;
	public static final int NOTPRIME = 0;
	public static final int ISFBA = 1;
	public static final int NOTFBA = 0;
	private long id = -1;
	private String number;
	private String itemNo;
	private String country;
	private int countryId;
	private int sourceId;
	private String name;
	private String description;
	private String feature;
	private String remark;
	private String offerListingId;
	private String url;
	private String ean;
	private int fav = -1;
	private int type = -1;
	private long categoryId = 0;
	private long rootCategoryId = 0;
	private String nav;
	private String price;
	private List<ProductCategoryVO> categoryList;
	private long sallerId = -1;
	private String sallerSN;
	private int brandId = 0;
	private String brand;
	private float star = 0;
	private int ranking = 0;
	private long subRanking = 0;
	private int review = 0;
	private int prime = 0;
	private int fba = 0;
	private String active;
	private long token = -1;
	private long followToken = -1;
	private long stockToken = -1;
	private int follow = 0;
	private int stock = -1;
	private long stockId = -1;
	private String group;
	private String groupType;
	private String groupValue;
	private String size;
	private String color;
	private List<String> groupProductItemList;
	private ProductItemAddInfoVO addInfoVO;
	private ProductImgUrlVO productImgUrlVO;
	private List<String> relationProductItemList;
	private List<String> alsoBoughtList;
	
	private int pageNo = 0;
	
	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}
	/**
	 * @return the number
	 */
	public String getNumber() {
		return number;
	}
	/**
	 * @param number the number to set
	 */
	public void setNumber(String number) {
		this.number = number;
	}
	/**
	 * @return the itemNo
	 */
	public String getItemNo() {
		return itemNo;
	}
	/**
	 * @param itemNo the itemNo to set
	 */
	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @return the feature
	 */
	public String getFeature() {
		return feature;
	}
	/**
	 * @param feature the feature to set
	 */
	public void setFeature(String feature) {
		this.feature = feature;
	}
	/**
	 * @return the sallerId
	 */
	public long getSallerId() {
		return sallerId;
	}
	/**
	 * @param sallerId the sallerId to set
	 */
	public void setSallerId(long sallerId) {
		this.sallerId = sallerId;
	}
	/**
	 * @return the categoryId
	 */
	public long getCategoryId() {
		return categoryId;
	}
	/**
	 * @param categoryId the categoryId to set
	 */
	public void setCategoryId(long categoryId) {
		this.categoryId = categoryId;
	}
	public long getRootCategoryId() {
		return rootCategoryId;
	}
	public void setRootCategoryId(long rootCategoryId) {
		this.rootCategoryId = rootCategoryId;
	}
	public String getNav() {
		return nav;
	}
	public void setNav(String nav) {
		this.nav = nav;
	}
	/**
	 * @return the price
	 */
	public String getPrice() {
		return price;
	}
	/**
	 * @param price the price to set
	 */
	public void setPrice(String price) {
		this.price = price;
	}
	/**
	 * @return the remark
	 */
	public String getRemark() {
		return remark;
	}
	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}
	/**
	 * @return the fav
	 */
	public int getFav() {
		return fav;
	}
	/**
	 * @param fav the fav to set
	 */
	public void setFav(int fav) {
		this.fav = fav;
	}
	/**
	 * @return the type
	 */
	public int getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(int type) {
		this.type = type;
	}
	/**
	 * @return the star
	 */
	public float getStar() {
		return star;
	}
	/**
	 * @param star the star to set
	 */
	public void setStar(float star) {
		this.star = star;
	}
	/**
	 * @return the ranking
	 */
	public int getRanking() {
		return ranking;
	}
	/**
	 * @param ranking the ranking to set
	 */
	public void setRanking(int ranking) {
		this.ranking = ranking;
	}
	public long getSubRanking() {
		return subRanking;
	}
	public void setSubRanking(long subRanking) {
		this.subRanking = subRanking;
	}
	/**
	 * @return the review
	 */
	public int getReview() {
		return review;
	}
	/**
	 * @param review the review to set
	 */
	public void setReview(int review) {
		this.review = review;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + countryId;
		result = prime * result + fba;
		result = prime * result + ((number == null) ? 0 : number.hashCode());
		result = prime * result + sourceId;
		return result;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (!(obj instanceof ProductItemVO)) {
			return false;
		}
		ProductItemVO other = (ProductItemVO) obj;
		if (countryId != other.countryId) {
			return false;
		}
		if (fba != other.fba) {
			return false;
		}
		if (number == null) {
			if (other.number != null) {
				return false;
			}
		} else if (!number.equals(other.number)) {
			return false;
		}
		if (sourceId != other.sourceId) {
			return false;
		}
		return true;
	}
	@Override
	protected Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
	public void setStar(String star) {
		if (star == null || star.trim().equals("")) {
			star = "-1";
		} 
		try {
			this.star = Float.parseFloat(star.trim());
		} catch (NumberFormatException e) {
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	public void setReview(String review) {
		if (review == null || review.trim().equals("")) {
			review = "-1";
		} 
		try {
			this.review = Integer.parseInt(review.trim());
		} catch (NumberFormatException e) {
			log.info(this.number + ":" + review + ":" + e.getMessage());
		} catch(Exception e) {
			log.info(this.number + ":" + review + ":" + e.getMessage());
			e.printStackTrace();
		}
		
	}
	public void setRanking(String ranking) {
		if (ranking == null || ranking.trim().equals("")) {
			ranking = "-1";
		} 
		try {
			this.ranking = Integer.parseInt(ranking.trim());
		} catch (NumberFormatException e) {
			log.info(this.number + ":" + ranking + ":" + e.getMessage());
			e.printStackTrace();
		} catch(Exception e) {
			log.info(this.number + ":" + ranking + ":" + e.getMessage());
			e.printStackTrace();
		}
	}
	/**
	 * @return the brandId
	 */
	public int getBrandId() {
		return brandId;
	}
	/**
	 * @param brandId the brandId to set
	 */
	public void setBrandId(int brandId) {
		this.brandId = brandId;
	}
	/**
	 * @return the brand
	 */
	public String getBrand() {
		return brand;
	}
	/**
	 * @param brand the brand to set
	 */
	public void setBrand(String brand) {
		this.brand = brand;
	}
	public String getSallerSN() {
		return sallerSN;
	}
	public void setSallerSN(String sallerSN) {
		this.sallerSN = sallerSN;
	}
	/**
	 * @return the isFBA
	 */
	public int getFba() {
		return fba;
	}
	/**
	 * @return the prime
	 */
	public int getPrime() {
		return prime;
	}
	/**
	 * @param prime the prime to set
	 */
	public void setPrime(int prime) {
		this.prime = prime;
	}
	/**
	 * @param fba the fba to set
	 */
	public void setFba(int fba) {
		this.fba = fba;
	}
	public String getActive() {
		return active;
	}
	public void setActive(String active) {
		this.active = active;
	}
	public long getToken() {
		return token;
	}
	public void setToken(long token) {
		this.token = token;
	}
	
	public int getFollow() {
		return follow;
	}
	public void setFollow(int follow) {
		this.follow = follow;
	}
	/**
	 * @return the stock
	 */
	public int getStock() {
		return stock;
	}
	/**
	 * @param stock the stock to set
	 */
	public void setStock(int stock) {
		this.stock = stock;
	}
	/**
	 * @return the stockId
	 */
	public long getStockId() {
		return stockId;
	}
	/**
	 * @param stockId the stockId to set
	 */
	public void setStockId(long stockId) {
		this.stockId = stockId;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "ProductItemVO [id=" + id + ", " + (number != null ? "number=" + number + ", " : "")
				+ (country != null ? "country=" + country + ", " : "") + "countryId=" + countryId + ", sourceId="
				+ sourceId + ", " + (name != null ? "name=" + name + ", " : "")
				+ (description != null ? "description=" + description + ", " : "")
				+ (feature != null ? "feature=" + feature + ", " : "")
				+ (remark != null ? "remark=" + remark + ", " : "")
				+ "type=" + (type >= 0? type : "-1") + ", "
				+ (size != null ? "size=" + size + ", " : "")
				+ (color != null ? "color=" + color + ", " : "")
				+ (createdBy != null ? "createdBy=" + createdBy + ", " : "")
				+ (lastUpdatedBy != null ? "lastUpdatedBy=" + lastUpdatedBy + ", " : "")
				+ (offerListingId != null ? "offerListingId=" + offerListingId + ", " : "")
				+ (url != null ? "url=" + url + ", " : "") + "fav=" + fav + ", categoryId=" + categoryId
				+ ", rootCategoryId=" + rootCategoryId + ", " + (nav != null ? "nav=" + nav + ", " : "")
				+ (price != null ? "price=" + price + ", " : "")
				+ (categoryList != null ? "categoryList=" + categoryList + ", " : "") + "sallerId=" + sallerId + ", "
				+ (sallerSN != null ? "sallerSN=" + sallerSN + ", " : "") + "brandId=" + brandId + ", "
				+ (brand != null ? "brand=" + brand + ", " : "") + "star=" + star + ", ranking=" + ranking
				+ ", subRanking=" + subRanking + ", review=" + review + ", prime=" + prime + ", fba=" + fba + ", "
				+ (active != null ? "active=" + active + ", " : "") + "token=" + token + ", followToken=" + followToken
				+ ", follow=" + follow + ", " + (group != null ? "group=" + group + ", " : "")
				+ (groupType != null ? "groupType=" + groupType + ", " : "")
				+ (groupValue != null ? "groupValue=" + groupValue + ", " : "")
				+ (groupProductItemList != null ? "groupProductItemList=" + groupProductItemList + ", " : "")
				+ (addInfoVO != null ? "addInfoVO=" + addInfoVO + ", " : "")
				+ (productImgUrlVO != null ? "productImgUrlVO=" + productImgUrlVO + ", " : "")
				+ (relationProductItemList != null ? "relationProductItemList=" + relationProductItemList + ", " : "")
				+ (alsoBoughtList != null ? "alsoBoughtList=" + alsoBoughtList + ", " : "") + "pageNo=" + pageNo + "]";
	}
	public long getFollowToken() {
		return followToken;
	}
	public void setFollowToken(long followToken) {
		this.followToken = followToken;
	}
	/**
	 * @return the stockToken
	 */
	public long getStockToken() {
		return stockToken;
	}
	/**
	 * @param stockToken the stockToken to set
	 */
	public void setStockToken(long stockToken) {
		this.stockToken = stockToken;
	}
	/**
	 * 产品分类列表
	 * @return 产品分类列表
	 */
	public List<ProductCategoryVO> getCategoryList() {
		return categoryList;
	}
	/**
	 * 产品分类列表
	 * @param categoryList 产品分类列表
	 */
	public void setCategoryList(List<ProductCategoryVO> categoryList) {
		this.categoryList = categoryList;
	}
	/**
	 * Get offerListingId
	 * @return offerListingId
	 */
	public String getOfferListingId() {
		return offerListingId;
	}
	/**
	 * Set offerListingId
	 * @param offerListingId the offerListingId to set
	 */
	public void setOfferListingId(String offerListingId) {
		this.offerListingId = offerListingId;
	}
	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}
	/**
	 * @param url the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}
	/**
	 * @return the ean
	 */
	public String getEan() {
		return ean;
	}
	/**
	 * @param ean the ean to set
	 */
	public void setEan(String ean) {
		this.ean = ean;
	}
	public String getGroup() {
		return group;
	}
	public void setGroup(String group) {
		this.group = group;
	}
	public String getGroupType() {
		return groupType;
	}
	public void setGroupType(String groupType) {
		this.groupType = groupType;
	}
	public String getGroupValue() {
		return groupValue;
	}
	public void setGroupValue(String groupValue) {
		this.groupValue = groupValue;
	}
	public List<String> getGroupProductItemList() {
		return groupProductItemList;
	}
	public void setGroupProductItemList(List<String> groupProductItemList) {
		this.groupProductItemList = groupProductItemList;
	}
	/**
	 * Get addInfoVO
	 * @return addInfoVO
	 */
	public final ProductItemAddInfoVO getAddInfoVO() {
		return addInfoVO;
	}
	/**
	 * Set addInfoVO
	 * @param addInfoVO the addInfoVO to set
	 */
	public final void setAddInfoVO(ProductItemAddInfoVO addInfoVO) {
		this.addInfoVO = addInfoVO;
	}
	/**
	 * Get relationProductItemList
	 * @return relationProductItemList
	 */
	public List<String> getRelationProductItemList() {
		return relationProductItemList;
	}
	/**
	 * Set relationProductItemList
	 * @param relationProductItemList the relationProductItemList to set
	 */
	public void setRelationProductItemList(List<String> relationProductItemList) {
		this.relationProductItemList = relationProductItemList;
	}
	/**
	 * Get pageNo
	 * @return pageNo
	 */
	public int getPageNo() {
		return pageNo;
	}
	/**
	 * Set pageNo
	 * @param pageNo the pageNo to set
	 */
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	/**
	 * Get alsoBoughtList
	 * @return alsoBoughtList
	 */
	public List<String> getAlsoBoughtList() {
		return alsoBoughtList;
	}
	/**
	 * Set alsoBoughtList
	 * @param alsoBoughtList the alsoBoughtList to set
	 */
	public void setAlsoBoughtList(List<String> alsoBoughtList) {
		this.alsoBoughtList = alsoBoughtList;
	}
	/**
	 * Get productImgUrlVO
	 * @return productImgUrlVO
	 */
	public ProductImgUrlVO getProductImgUrlVO() {
		return productImgUrlVO;
	}
	/**
	 * Set productImgUrlVO
	 * @param productImgUrlVO the productImgUrlVO to set
	 */
	public void setProductImgUrlVO(ProductImgUrlVO productImgUrlVO) {
		this.productImgUrlVO = productImgUrlVO;
	}
	/**
	 * @return the country
	 */
	public final String getCountry() {
		return country;
	}
	/**
	 * @param country the country to set
	 */
	public final void setCountry(String country) {
		this.country = country;
	}
	/**
	 * @return the countryId
	 */
	public int getCountryId() {
		return countryId;
	}
	/**
	 * @param countryId the countryId to set
	 */
	public void setCountryId(int countryId) {
		this.countryId = countryId;
	}
	/**
	 * @return the sourceId
	 */
	public int getSourceId() {
		return sourceId;
	}
	/**
	 * @param sourceId the sourceId to set
	 */
	public void setSourceId(int sourceId) {
		this.sourceId = sourceId;
	}
	/**
	 * @return the size
	 */
	public String getSize() {
		return size;
	}
	/**
	 * @param size the size to set
	 */
	public void setSize(String size) {
		this.size = size;
	}
	/**
	 * @return the color
	 */
	public String getColor() {
		return color;
	}
	/**
	 * @param color the color to set
	 */
	public void setColor(String color) {
		this.color = color;
	}
	
}
